﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace canyinguanlixitong
{
    public partial class frm库存变动 : Form
    {
        public frm库存变动()
        {
            InitializeComponent();
        }
        string str = "Data Source=.;Initial Catalog=Supermarket management system;Integrated Security=True";
      //查询
        private void button4_Click(object sender, EventArgs e)
        {
            chaxun();
        }
        //退出
        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
      
        public void chaxun() {
            SqlConnection conn = new SqlConnection(str);
            DataSet ds = new DataSet("Student");
            string sql = "select spName,slLei,spJia,spLei from dbo.commodity,[Commodity type] where commodity.spLei=[Commodity type].SlId";
            SqlDataAdapter asdf = new SqlDataAdapter(sql,conn);
            asdf.Fill(ds,"Student");
            this.dataGridView1.DataSource = ds.Tables["Student"];

        }
    
    
    }
}
